<?php
$string = "../classes/".$_GET['classes'].".php";
require_once($string);
$ponteiro = new $_GET['class']();
$id = intval($_GET['id_img']);
$ponteiro->carregaDadosPorId($id);
if(isset($_POST['valida']))
{
	$ponteiro->carregaDados($_POST);
	$ponteiro->update($_POST['id']);
	header("location:editar.php?id_img=".$_POST['id']."&classes=".$_POST['classes']."&class=".$_POST['class']);		
	
}


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Editar Fotos</title>
<link rel="stylesheet" href="../css/style.css" type="text/css" media="all"/>

</head>


<body>

	<form  action="" method="POST" enctype="multipart/form-data">
    	 <div class="class-form-1">
            <div class="class-form-1-holder">
                <p>Legenda da foto selecionada</p>
                <input type="text" name="legenda" id="legenda" value="<?php echo $ponteiro->imprime($ponteiro->legenda) ?>" />
                <input type="hidden" name="id" id="id" value="<?php echo $id ?>" />
                <input type="hidden" name="classes" id="classes" value="<?php echo $_GET['classes'] ?>" />
                <input type="hidden" name="class" id="class" value="<?php echo $_GET['class'] ?>" />
                <input type="hidden" name="valida" id="valida" value="ok" />
            </div>
        </div>
    	<div class="holder-btns">
            <input type="image" src="../imgs/btn-cadastrar.jpg" alt="Cadastar" />
        </div>
    </form>
    
     
	
	 
 

</body>

</html>